package com.google.samples.apps.room.data

import androidx.lifecycle.LiveData
import androidx.room.*

/**
 * Created by Administrator on 2021/7/9 0009.
 * Describe:
 */
@Dao
interface UserDao {

    @Insert
    fun insertUser(user: User)

    @Delete
    fun deleteUser(user: User)

    @Update
    fun updateUser(user: User)

    @Query("select * from users where id = :userId")
    fun getUserById(userId: Long): User

    @Query("select * from users")
    fun getUsers(): LiveData<List<User>>

}